package com.huan.dubbo.service;

import com.huan.dubbo.service.OrderPay;
import org.apache.dubbo.rpc.model.ScopeModel;
import org.apache.dubbo.rpc.model.ScopeModelUtil;

/**
 * OrderPay 接口方法 适应类
 */
public class OrderPay$Adaptive implements OrderPay {
    public java.lang.String payAdaptive(org.apache.dubbo.common.URL arg0) {
        if (arg0 == null) throw new IllegalArgumentException("url == null");
        org.apache.dubbo.common.URL url = arg0;
        String extName = url.getParameter("order.pay", "aliPay");
        if (extName == null)
            throw new IllegalStateException("Failed to get extension (com.huan.dubbo.service.OrderPay) name from url (" + url.toString() + ") use keys([order.pay])");
        ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), OrderPay.class);
        OrderPay extension = (OrderPay) scopeModel.getExtensionLoader(OrderPay.class).getExtension(extName);
        return extension.payAdaptive(arg0);
    }

    public java.lang.String pay() {
        throw new UnsupportedOperationException("The method public abstract java.lang.String com.huan.dubbo.service.OrderPay.pay() of interface com.huan.dubbo.service.OrderPay is not adaptive method!");
    }
}
